package hrm.serviceimple;

import hrm.dao.FamilyDAO;
import hrm.daoimple.FamilyDAOImple;
import hrm.dto.insa.FamilyDTO;
import hrm.service.FamilyService;

import java.util.List;

public class FamilyServiceImple implements FamilyService{
		
	private FamilyDAO familyDAO;
	private static FamilyServiceImple familyService;
	
	private FamilyServiceImple(){
		familyDAO=new FamilyDAOImple();
	}
	
	public static FamilyServiceImple getInstance(){
		if (familyService==null) {
			familyService=new FamilyServiceImple();
		}
		return familyService;
	}
	
	public void setFamilyDAO(FamilyDAO familyDAO) {
		this.familyDAO = familyDAO;
	}

	@Override
	public List<FamilyDTO> getFamily(FamilyDTO dto) {
		return familyDAO.getFamily(dto);
	}

	@Override
	public void updateFamily(FamilyDTO command) {
		familyDAO.updateFamily(command);
	}

	@Override
	public void insertFamily(FamilyDTO command) {
		familyDAO.insertFamily(command);
	}

	@Override
	public void deleteFamily(FamilyDTO command) {
		familyDAO.deleteFamily(command);
	}	

}
